<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 移动端特有设置，解决移动端屏幕过小，放不下正常网页的问题 -->
    <!-- <meta name="viewport" content="width=device-width"> -->
    <!-- 当不设置viewport时，视口大小默认为980 -->
    <!-- 可通过js动态设置viewport -->
    <script>
       (function () {
      var metaEl = document.createElement('meta');
      var scale = devicePixelRatio;
      metaEl.setAttribute('name', 'viewport');
      metaEl.setAttribute('content', 'initial-scale=' + (1/scale) + ', maximum-scale=' + (1/scale) + ', minimum-scale=' + (1/scale) + ', user-scalable=no');
      document.documentElement.firstElementChild.appendChild(metaEl);
        })();

        // root em设置
        (function(){
            var doc=document.documentElement;
            doc.style.fontSize=window.innerWidth/15+'px';
        })();
        // 1rem=1屏幕尺寸的15分之一
    </script>
    <title>Document</title>
    <style>
        body{
            margin:0;
        }
        #box{
            display: flex;
        }
        #box div{
            width:6.96rem;
            height:3.6rem;
            background-color: red;
            margin:0 0.2rem;
            font-size:.64rem;
        }
    </style>

    <script>
        console.log("像素比：",window.devicePixelRatio)
        // 像素比：原先1px的内容放大到到devicePixelRatio px显示
    </script>
</head>
<body>
    <div id="box">
        <div>尖货抽签</div>
        <div>新品日历</div>
    </div>
</body>
</html>